#
# Be sure to run `pod lib lint CordovaPlugin.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
#

Pod::Spec.new do |s|
  s.name             = 'CordovaPlugin'
  s.version          = '0.1.0'
  s.summary          = 'Plugin for Cordova.'

# This description is used to generate tags and improve search results.
#   * Think: What does it do? Why did you write it? What is the focus?
#   * Try to keep it short, snappy and to the point.
#   * Write the description between the DESC delimiters below.
#   * Finally, don't worry about the indent, CocoaPods strips it!

  s.description      = <<-DESC
TODO: Cordova插件库,提供所有Cordova插件.
                       DESC

  s.homepage         = 'http://git.evun.cn/ADMP-repository/sweet-iOS-CordovaPlugin'
  # s.screenshots     = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
  s.license          = { :type => 'MIT', :file => 'LICENSE' }
  s.author           = { 'Haisens' => 'haisens@163.com' }
  s.ios.deployment_target = '8.0'
  
  # s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'
if ENV['mode'].to_s.include? "CordovaPlugin"
    #使用zip成果物模式
    puts "CordovaPlugin成果物模式集成".blue
    s.source           = { :http => 'https://geely-admp-oss.oss-cn-hangzhou.aliyuncs.com/sweet-app-release/ios/CordovaPlugin.framework-0.1.0.zip' }
    s.ios.vendored_framework   = 'CordovaPlugin.framework'
    s.source_files = 'CordovaPlugin.framework/**/*.h'
    s.public_header_files = 'CordovaPlugin.framework/**/*.h'
else
    #目前默认源码集成
    puts "CordovaPlugin源码模式集成".yellow
    s.source           = { :git => 'https://gitlab.geely.com/p-admp/ios-common-kit/ios-sweetcordovaplugin.git', :tag => s.version.to_s }
    s.source_files = 'CordovaPlugin/Classes/*.{h,m}'
    s.public_header_files = 'CordovaPlugin/Classes/*.h'
    
    s.subspec 'Camera' do |ss|
        ss.source_files = 'CordovaPlugin/Classes/Camera/*.{h,m}'
        ss.public_header_files = 'CordovaPlugin/Classes/Camera/*.h'
        ss.dependency 'CordovaPlugin/Configuration'
    end
end

  
  s.dependency 'Cordova'

  s.framework = [ "CoreTelephony", "SystemConfiguration", "CoreLocation" ]
  s.dependency 'SweetCoreKit'
  s.dependency 'AFNetworking'

  s.dependency 'QRCodeReaderViewController'
  s.dependency 'HybridImplementKit'

  s.dependency 'Base64'

  
end
